package cn.gcjxsc.service;

import org.springframework.beans.BeanUtils;

/**
 * @author pumbaa
 * @since 1.0
 */
public class CommonService {

    public <D> D converter(Object object, Class<D> clazz) {
        try {
            D d = clazz.newInstance();
            BeanUtils.copyProperties(object, d);
            return d;
        } catch (Exception e) {
            return null;
        }
    }
}
